/**
 * 请求根地址
 * @type {string}
 */
var BASE_URL = "http://www.perservice18.online:8888/";
//var BASE_URL = "/tdp/";


/**
 * 请求地址
 */
var REQUEST_URL = {
    BASE_URL: BASE_URL,
    LOGIN: {
        login: BASE_URL + "user/login",
        logout: BASE_URL + "user/logout",
        getCurrentUserInfo: BASE_URL + "user/currentUser/info",
    },
    CONFIG: {
        getDict: BASE_URL + "test/config"
    },
    WEB_ELEMENT: {
        listNode: BASE_URL + "sut/page",
        addNode: BASE_URL + "sut/page?c=addNode",
        editNode: BASE_URL + "sut/page?c=editNode",
        delNode: BASE_URL + "sut/page?c=delNode",

        moveElement: BASE_URL + 'sut/page?c=changeElementsPage',

        listElement: BASE_URL + "sut/page/element",
        editElement: BASE_URL + "sut/page/element?c=edit",
        delElement: BASE_URL + "sut/page/element?c=del",
        getElement: BASE_URL + "sut/page/element?c=elementInfo",

        queryParams: BASE_URL + 'sut/page/element?c=params' //查询配置参数
    },
    WEB_CASE: {
        listNode: BASE_URL + "test/case/classify",
        addNode: BASE_URL + "test/case/classify?c=addClassify",
        editNode: BASE_URL + "test/case/classify?c=editClassify",
        delNode: BASE_URL + "test/case/classify?c=delClassify",

        moveCase: BASE_URL + 'test/case/classify?c=changeCaseClass',

        listCase: BASE_URL + "test/case",
        editCase: BASE_URL + "test/case?c=edit",
        delCase: BASE_URL + "test/case?c=del",
        getCase: BASE_URL + "test/case?c=caseInfo",

        queryParams: BASE_URL + 'test/case?c=params', //查询配置参数

        listAll: BASE_URL + 'test/case?c=allCase'
    },
    WEB_CASE_STEP: {
        listStep: BASE_URL + "test/step",
        editStep: BASE_URL + "test/step?c=edit",
        delStep: BASE_URL + "test/step?c=del",
        getStep: BASE_URL + "test/step?c=stepInfo",
        updateData: BASE_URL + "test/step?c=updateData",

        sortStep: BASE_URL + "test/step?c=stepsSort",

        queryParams: BASE_URL + 'test/step?c=params' //查询配置参数
    },
    WEB_CASE_SET: {
        listSet: BASE_URL + "test/set",
        editSet: BASE_URL + "test/set?c=editSet",
        delSet: BASE_URL + "test/set?c=del",
        getSet: BASE_URL + "test/set?c=testSetInfo",
        addCase2Set: BASE_URL + "test/set?c=addCases2Set",
        delCase2Set: BASE_URL + "test/set?c=delCases",
        listSetCase: BASE_URL + "test/set?c=setCaseInfo",
        sortSetCase: BASE_URL + "test/set?c=caseSort"
    },
    WEB_EXECUTION_MACHINE: {
        listMachine: BASE_URL + "tdp/executor/group?c=slaveInfo", //获取执行机列表

        addManagerMachine: BASE_URL + "tdp/executor?c=add", //添加对此执行机的管理
        delManagerMachine: BASE_URL + "tdp/executor?c=del", //删除对此执行机的管理
        getMachine: BASE_URL + "tdp/executor", //获取指定执行机的信息
        editMachine: BASE_URL + "tdp/executor?c=edit", //编辑此执行机信息

        breakSlave: BASE_URL + "tdp/executor?c=breakSlave", //断开连接

        listNotExistGroupMachine: BASE_URL + "tdp/executor/group?c=notInGroupSlaveInfo",

        listAcceptMachine: BASE_URL + 'tdp/executor?c=acceptedSlaves',

        downloadSlave: BASE_URL + 'static/tdp/slave.zip'
    },
    WEB_EXECUTION_MACHINE_GROUP: {
        listGroup: BASE_URL + "tdp/executor/group", //执行机组查询
        editGroup: BASE_URL + "tdp/executor/group?c=edit", //编辑、新增组信息
        getGroup: BASE_URL + "tdp/executor/group?c=groupInfo", //获取指定组信息
        delGroup: BASE_URL + "tdp/executor/group?c=del", //删除组信息

        addMachine2Group: BASE_URL + "tdp/executor/group?c=addSlave", //添加执行机到组中
        delMachineFromGroup: BASE_URL + "tdp/executor/group?c=delSlave" //从组中删除执行机
    },
    WEB_TEST_PLAN: {
        listPlan: BASE_URL + 'test/plan',//测试计划查询
        editPlan: BASE_URL + 'test/plan',//编辑、新增测试计划
        getPlan: BASE_URL + 'test/plan?c=planInfo',//获取指定测试计划信息
        delPlan: BASE_URL + 'test/plan?c=del',//删除测试计划

        addSet2Plan: BASE_URL + 'test/plan?c=addTestset',//添加测试集到测试计划
        delSetFromPlan: BASE_URL + 'test/plan?c=delTestset', //从测试计划中删除测试集

        listPlanSet: BASE_URL + 'test/plan?c=testset', //指定计划中的测试集
        updateData: BASE_URL + 'test/plan?c=updateData', //更新测试数据
        execute: BASE_URL + 'test/plan?c=execPlan&way=byHand',
        updateSetData: BASE_URL + 'test/plan?c=testsetTestdata'

    },
    WEB_TEST_TASK: {
        list: BASE_URL + 'test/job',
        del: BASE_URL + 'test/job?c=del',

        execSummary: BASE_URL + 'test/job?c=testsetsExecSummary',
        log: BASE_URL + 'test/job?c=testsetLog',
        report_url: BASE_URL + 'test/job?c=jobReport&job_id=',
        stop: BASE_URL + 'test/job?c=stop'
    }
};

/**
 * 全局一些参数配置
 */
var GLOBAL_PARAM = {
    //后端返回码
    RETURN_CODE: {
        SUCCESS: "0",
        NO_LOGIN: "9999"
    },
    //元素节点类型
    ELEMENT_NODE_LEVEL: {
        ROOT : {
            value: 0,
            name: "根节点"
        },
        SYSTEM: {
            value: 1,
            name: "系统"
        },
        PAGE: {
            value: 2,
            name: "页面"
        }
    },
    CUSTOM_JUDGE_TYPE: {
        '0': '否',
        '1': '是'
    },
    TEST_PLAN_STATUS: {
        '1': '开启',
        '0': '关闭'
    },
    TEST_TASK_STATUS: {
        wait: '等待执行',
        completed: '执行完成',
        running: '执行中'
    },
    SLAVE_MACHINE_NO_GROUP_ID: 1
};

/**
 * 该配置由后端返回
 *
 "id": 7,
 "en_name": "id",
 "cn_name": "id",
 "word_type": 11,
 "mark": null

 * @type {{}}
 */
var DICT_CONFIG = {
    //关键字
    keyword: {
        web_ui: [],
        app: [],
        interface: [],
        database: [],
        windows_ui: []
    },
    //用例类型
    case_type: [],
    //定位类型
    location_by: [],
    //步骤的逻辑控制符
    step_control: [],
    //步骤类型
    step_type: [],
    //元素类型
    element_type: []
};
